package view.inventory.menu
{
import core.Language;
import core.manager.MapBuildingManager;

import framework.view.components.button.ButtonProxy;

import values.item.BuildingItemValue;


/**
 * InventoryBuildingItemMenuProxy
 * @author jliang
 *
 */
public class InventoryBuildingItemMenuProxy extends InventoryItemMenuProxy
{
	//==========================================================================
	//  Constructor
	//==========================================================================
	public function InventoryBuildingItemMenuProxy()
	{
		super();
	}
	//==========================================================================
	//  Overridden methods: ComponentProxy
	//==========================================================================	
	override protected function get proxyMapping():Array
	{
		return [ 
			{ skin:"useBtn", classRef: ButtonProxy, id:"useBtn", text:Language.getText("@build_button_label"), onClick: useHandler }
		].concat(super.proxyMapping);
	}	
	//==========================================================================
	//  Event handlers
	//==========================================================================
	protected function useHandler():void
	{		
		MapBuildingManager.create(data as BuildingItemValue);
        
        Game.instance.inventoryUI.close();
	}
}
}




